package com.tanhua.model.vo;


import com.tanhua.model.domian.Title;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TitleVo implements Serializable {
    private String id;
    private String question;
    private List<OptionVo> options;

    public static TitleVo init(Title title){
        TitleVo titleVo = new TitleVo();
        BeanUtils.copyProperties(title, titleVo);
        titleVo.setId(title.getId().toString());
        return titleVo;
    }

}
